package com.my.action;

import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.my.service.BookService;

@Controller
public class AbcAction {

	@Autowired
	BookService bookService;

	@RequestMapping("abc")
	@ResponseBody
	public ModelAndView abc(HttpServletRequest request, HttpServletResponse response) {

		ModelAndView mode = new ModelAndView("abc");
		return mode;
	}
	
	@RequestMapping("product")
	@ResponseBody
	public List<HashMap<String, Object>> product(HttpServletRequest request,
			HttpServletResponse response) {
		HashMap<String, Object> wherMap = new HashMap<String, Object>();
		List<HashMap<String, Object>> product = bookService.queryProduct(wherMap);
		System.out.println("============="+product);
		return product;
	}
}
